<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>选择变更表单</title>
</head>
<body>
<div style="max-width: 450px;max-height: 450px;">
    <form id="form" role="form" method="post" >
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="stage">选择变更表单</label>
                    <select class="form-control" id="stage" name="stage">
                        <option th:each="model:${changeFroms}"
                                th:value="${model.getId()}"
                                th:text="${model.getChangeNo()}"
                        >
                        </option>
                    </select>
                </div>
            </div>
        </div>
    </form>
</div>
<script th:inline="javascript">
    <![CDATA[
    var projectPuid = getProjectUid();
    $(function () {
        // 绑定dialog的确定按钮的监听事件
        $("#btnOk", window.top.document).click(function () {
            var changeFromId = $("#stage option:selected").val();
            $.ajax({
                type: "POST",
                //ajax需要添加打包名
                url: "./relevance/getChange?projectPuid="+projectPuid+"&changeFromId="+changeFromId,
                success: function (result) {
                    activeTabBodyRefresh();
                    if (result.status) {
                        layer.msg(result.msg, {icon: 1, time: 2000});
                    }
                    else {
                        window.Ewin.alert({message: result.msg});
                    }
                    $table.bootstrapTable("refresh");
                },
                error: function (info) {
                    window.Ewin.alert({message: "操作发送失败:" + info.status});
                }
            })
        });
    })
    ]]>
</script>
</body>
</html>